#include "../pre_emptive_os/api/osapi.h"
#include "../pre_emptive_os/api/general.h"
#include <printf_P.h>
#include <lpc2xxx.h>
#include <consol.h>
#include "../startup/config.h"

#define CRYSTAL_FREQUENCY FOSC
#define PLL_FACTOR        PLL_MUL
#define VPBDIV_FACTOR     PBSD
#define VREF_IN_MV 2178

/*****************************************************************************
 *
 * Description:
 *    Start a conversion of one selected analogue input and return
 *    10-bit result.
 *
 * Params:
 *    [in] channel - analogue input channel to convert.
 *
 * Return:
 *    10-bit conversion result
 *
 ****************************************************************************/
int getAnalogueInput(int channel);

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Initilizes LM75
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void initLM75();

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Reads temperature from LM75
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
int readTemperature();
